Skip to content

Check a type tag instead of instanceof before unwrapping a native object - #2629

Merged
chearon merged 1 commit into
Automattic:masterfrom
theosotr:master
Oct 20, 2026
Merged

chearon merged 1 commit into
Automattic:masterfrom
theosotr:master

Conversation

@theosotr

@theosotr theosotr commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Fixes #2628

Thanks for contributing!

  • Have you updated CHANGELOG.md?

@chearon chearon left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but I'd like to remove the duplicate calls to GetInstanceData and probably put all InstanceData* data = env.GetInstanceData<InstanceData>(); on their own line.

Comment thread src/Canvas.cc Resolved
Comment thread src/CanvasPattern.cc Resolved
Comment thread src/CanvasRenderingContext2d.cc Resolved
@theosotr

Copy link
Copy Markdown
Contributor Author

Thanks for the review; done.

@chearon chearon left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks!

@chearon
chearon merged commit ec8ade4 into Automattic:master Oct 20, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bypassing the InstanceOf checks leads to crashes in Unwrap calls

2 participants